package com.hkemmm.shop.service.impl;

import com.hkemmm.shop.dao.AddreasMapper;
import com.hkemmm.shop.dao.AreasMapper;
import com.hkemmm.shop.dao.CitiesMapper;
import com.hkemmm.shop.dao.ProvincesMapper;
import com.hkemmm.shop.entity.*;
import com.hkemmm.shop.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressService implements IAddressService {

    @Autowired
    private ProvincesMapper provincesMapper;
    @Autowired
    private CitiesMapper citiesMapper;
    @Autowired
    private AreasMapper areasMapper;
    @Autowired
    private AddreasMapper addreasMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return addreasMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Provinces> getAllProvinces() {
        return provincesMapper.getAllProvinces();
    }

    @Override
    public List<Cities> getAllCities(String pid) {
        return citiesMapper.getAllCities(pid);
    }

    @Override
    public List<Areas> getAllAreas(String cid) {
        return areasMapper.getAllAreas(cid);
    }

    @Override
    public Addreas selectByPrimaryKey(Integer id) {
        return addreasMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<AddressInfo> getAddressInfo(Integer uid) {
        return addreasMapper.getAddressInfo(uid);
    }

    @Override
    public int insertSelective(Addreas record) {
        return addreasMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelective(Addreas record) {
        return addreasMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int setDefault(Integer id) {
        return addreasMapper.setDefault(id);
    }

    @Override
    public int setAllAddresDefault(Integer uid) {
        return addreasMapper.setAllAddresDefault(uid);
    }

    @Override
    public Addreas getOneAddress(Integer uid) {
        return addreasMapper.getOneAddress(uid);
    }

    @Override
    public int addresNum(Integer uid) {
        return addreasMapper.addresNum(uid);
    }


}
